﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;

namespace Teigha.Core
{
	public class OdGeEllipArc2d : OdGeCurve2d
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdGeEllipArc2d(IntPtr cPtr, bool cMemoryOwn) : base(GlobalsPINVOKE.OdGeEllipArc2d_SWIGUpcast(cPtr), cMemoryOwn)
		{
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdGeEllipArc2d obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdGeEllipArc2d()
		{
			this.Dispose();
		}

		public override void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							GlobalsPINVOKE.delete_OdGeEllipArc2d(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
			base.Dispose();
		}

		public OdGeEllipArc2d() : this(GlobalsPINVOKE.new_OdGeEllipArc2d__SWIG_0(), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeEllipArc2d(OdGeEllipArc2d ell) : this(GlobalsPINVOKE.new_OdGeEllipArc2d__SWIG_1(OdGeEllipArc2d.getCPtr(ell)), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeEllipArc2d(OdGeCircArc2d arc) : this(GlobalsPINVOKE.new_OdGeEllipArc2d__SWIG_2(OdGeCircArc2d.getCPtr(arc)), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeEllipArc2d(OdGePoint2d center, OdGeVector2d majorAxis, OdGeVector2d minorAxis, double majorRadius, double minorRadius) : this(GlobalsPINVOKE.new_OdGeEllipArc2d__SWIG_3(OdGePoint2d.getCPtr(center), OdGeVector2d.getCPtr(majorAxis).Handle, OdGeVector2d.getCPtr(minorAxis).Handle, majorRadius, minorRadius), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeEllipArc2d(OdGePoint2d center, OdGeVector2d majorAxis, OdGeVector2d minorAxis, double majorRadius, double minorRadius, double startAng, double endAng) : this(GlobalsPINVOKE.new_OdGeEllipArc2d__SWIG_4(OdGePoint2d.getCPtr(center), OdGeVector2d.getCPtr(majorAxis).Handle, OdGeVector2d.getCPtr(minorAxis).Handle, majorRadius, minorRadius, startAng, endAng), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public bool intersectWith(OdGeLinearEnt2d line, out int numInt, OdGePoint2d p1, OdGePoint2d p2, OdGeTol tol)
		{
			bool result = GlobalsPINVOKE.OdGeEllipArc2d_intersectWith__SWIG_0(this.swigCPtr, OdGeLinearEnt2d.getCPtr(line), out numInt, OdGePoint2d.getCPtr(p1), OdGePoint2d.getCPtr(p2), OdGeTol.getCPtr(tol));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool intersectWith(OdGeLinearEnt2d line, out int numInt, OdGePoint2d p1, OdGePoint2d p2)
		{
			bool result = GlobalsPINVOKE.OdGeEllipArc2d_intersectWith__SWIG_1(this.swigCPtr, OdGeLinearEnt2d.getCPtr(line), out numInt, OdGePoint2d.getCPtr(p1), OdGePoint2d.getCPtr(p2));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isCircular(OdGeTol tol)
		{
			bool result = GlobalsPINVOKE.OdGeEllipArc2d_isCircular__SWIG_0(this.swigCPtr, OdGeTol.getCPtr(tol));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isCircular()
		{
			bool result = GlobalsPINVOKE.OdGeEllipArc2d_isCircular__SWIG_1(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isInside(OdGePoint2d point, OdGeTol tol)
		{
			bool result = GlobalsPINVOKE.OdGeEllipArc2d_isInside__SWIG_0(this.swigCPtr, OdGePoint2d.getCPtr(point), OdGeTol.getCPtr(tol));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isInside(OdGePoint2d point)
		{
			bool result = GlobalsPINVOKE.OdGeEllipArc2d_isInside__SWIG_1(this.swigCPtr, OdGePoint2d.getCPtr(point));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGePoint2d center()
		{
			OdGePoint2d result = new OdGePoint2d(GlobalsPINVOKE.OdGeEllipArc2d_center(this.swigCPtr), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public double minorRadius()
		{
			double result = GlobalsPINVOKE.OdGeEllipArc2d_minorRadius(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public double majorRadius()
		{
			double result = GlobalsPINVOKE.OdGeEllipArc2d_majorRadius(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeVector2d minorAxis()
		{
			OdGeVector2d result = new OdGeVector2d(GlobalsPINVOKE.OdGeEllipArc2d_minorAxis(this.swigCPtr), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeVector2d majorAxis()
		{
			OdGeVector2d result = new OdGeVector2d(GlobalsPINVOKE.OdGeEllipArc2d_majorAxis(this.swigCPtr), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public double startAng()
		{
			double result = GlobalsPINVOKE.OdGeEllipArc2d_startAng(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public double endAng()
		{
			double result = GlobalsPINVOKE.OdGeEllipArc2d_endAng(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGePoint2d startPoint()
		{
			OdGePoint2d result = new OdGePoint2d(GlobalsPINVOKE.OdGeEllipArc2d_startPoint(this.swigCPtr), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGePoint2d endPoint()
		{
			OdGePoint2d result = new OdGePoint2d(GlobalsPINVOKE.OdGeEllipArc2d_endPoint(this.swigCPtr), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isClockWise()
		{
			bool result = GlobalsPINVOKE.OdGeEllipArc2d_isClockWise(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeEllipArc2d setCenter(OdGePoint2d center)
		{
			OdGeEllipArc2d result = new OdGeEllipArc2d(GlobalsPINVOKE.OdGeEllipArc2d_setCenter(this.swigCPtr, OdGePoint2d.getCPtr(center)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeEllipArc2d setMinorRadius(double rad)
		{
			OdGeEllipArc2d result = new OdGeEllipArc2d(GlobalsPINVOKE.OdGeEllipArc2d_setMinorRadius(this.swigCPtr, rad), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeEllipArc2d setMajorRadius(double rad)
		{
			OdGeEllipArc2d result = new OdGeEllipArc2d(GlobalsPINVOKE.OdGeEllipArc2d_setMajorRadius(this.swigCPtr, rad), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeEllipArc2d setAxes(OdGeVector2d majorAxis, OdGeVector2d minorAxis)
		{
			OdGeEllipArc2d result = new OdGeEllipArc2d(GlobalsPINVOKE.OdGeEllipArc2d_setAxes(this.swigCPtr, OdGeVector2d.getCPtr(majorAxis).Handle, OdGeVector2d.getCPtr(minorAxis).Handle), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeEllipArc2d setAngles(double startAng, double endAng)
		{
			OdGeEllipArc2d result = new OdGeEllipArc2d(GlobalsPINVOKE.OdGeEllipArc2d_setAngles(this.swigCPtr, startAng, endAng), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeEllipArc2d set(OdGePoint2d center, OdGeVector2d majorAxis, OdGeVector2d minorAxis, double majorRadius, double minorRadius)
		{
			OdGeEllipArc2d result = new OdGeEllipArc2d(GlobalsPINVOKE.OdGeEllipArc2d_set__SWIG_0(this.swigCPtr, OdGePoint2d.getCPtr(center), OdGeVector2d.getCPtr(majorAxis).Handle, OdGeVector2d.getCPtr(minorAxis).Handle, majorRadius, minorRadius), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeEllipArc2d set(OdGePoint2d center, OdGeVector2d majorAxis, OdGeVector2d minorAxis, double majorRadius, double minorRadius, double startAng, double endAng)
		{
			OdGeEllipArc2d result = new OdGeEllipArc2d(GlobalsPINVOKE.OdGeEllipArc2d_set__SWIG_1(this.swigCPtr, OdGePoint2d.getCPtr(center), OdGeVector2d.getCPtr(majorAxis).Handle, OdGeVector2d.getCPtr(minorAxis).Handle, majorRadius, minorRadius, startAng, endAng), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeEllipArc2d set(OdGeCircArc2d arc)
		{
			OdGeEllipArc2d result = new OdGeEllipArc2d(GlobalsPINVOKE.OdGeEllipArc2d_set__SWIG_2(this.swigCPtr, OdGeCircArc2d.getCPtr(arc)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeEllipArc2d Assign(OdGeEllipArc2d ell)
		{
			OdGeEllipArc2d result = new OdGeEllipArc2d(GlobalsPINVOKE.OdGeEllipArc2d_Assign(this.swigCPtr, OdGeEllipArc2d.getCPtr(ell)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void getGeomExtents(OdGeExtents2d extents)
		{
			GlobalsPINVOKE.OdGeEllipArc2d_getGeomExtents(this.swigCPtr, OdGeExtents2d.getCPtr(extents));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void inverseTangent(OdGeVector2d tan, OdGeDoubleArray arg1)
		{
			GlobalsPINVOKE.OdGeEllipArc2d_inverseTangent(this.swigCPtr, OdGeVector2d.getCPtr(tan), OdGeDoubleArray.getCPtr(arg1));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		private object locker = new object();

		private HandleRef swigCPtr;
	}
}
